package com.kgc.scd.service;

import com.kgc.scd.annotation.RequestPermission;
import com.kgc.scd.annotation.RequestUser;
import com.kgc.scd.bean.Cart;
import com.kgc.scd.bean.CartItem;
import com.kgc.scd.util.PageSupport;
import com.kgc.scd.util.RequestResult;
import com.kgc.scd.util.UserAnno;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created On : 2022/6/11.
 * <p>
 * Author     : 98730
 * <p>
 * Description: 购物车业务接口
 */
@FeignClient(value = "blmall-server-jzp-8102")
public interface CartService {

    @PostMapping("/addCart")
    RequestResult<String> addCart(@RequestBody Cart cart);

    @PostMapping("/delCart")
    RequestResult<String> delCart(@RequestParam("cartId") List<Integer> cartId, @RequestBody UserAnno user);

    @PostMapping("/queryCart")
    RequestResult<PageSupport<CartItem>> queryCartListByPage(@RequestParam(value = "pageNo" ,defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "3") Integer pageSize, @RequestBody UserAnno user);

    @PostMapping("/modCartList")
    RequestResult<String> modCartList(@RequestParam("proId") String proId, @RequestParam(value = "count",defaultValue = "1") Integer count, @RequestBody UserAnno userAnno);
}